package drds.binlog.parse.inbound.mysql.ddl;

import drds.binlog.protocol.entry_protocol_proto.EventType;


public class DdlResult
{

    private String schemaName;
    private String tableName;
    private String oriSchemaName;    // rename ddl中的源表
    private String oriTableName;     // rename ddl中的目标表
    private EventType type;
    private DdlResult renameTableResult; // 多个rename table的存储

    /*
     * RENAME TABLE tbl_name TO new_tbl_name [, tbl_name2 TO new_tbl_name2] ...
     */

    public DdlResult()
    {
    }

    public DdlResult(String schemaName)
    {
        this.schemaName = schemaName;
    }

    public DdlResult(String schemaName, String tableName)
    {
        this.schemaName = schemaName;
        this.tableName = tableName;
    }

    public DdlResult(String schemaName, String tableName, String oriSchemaName, String oriTableName)
    {
        this.schemaName = schemaName;
        this.tableName = tableName;
        this.oriSchemaName = oriSchemaName;
        this.oriTableName = oriTableName;
    }

    public String getSchemaName()
    {
        return schemaName;
    }

    public void setSchemaName(String schemaName)
    {
        this.schemaName = schemaName;
    }

    public String getTableName()
    {
        return tableName;
    }

    public void setTableName(String tableName)
    {
        this.tableName = tableName;
    }

    public EventType getType()
    {
        return type;
    }

    public void setType(EventType type)
    {
        this.type = type;
    }

    public String getOriSchemaName()
    {
        return oriSchemaName;
    }

    public void setOriSchemaName(String oriSchemaName)
    {
        this.oriSchemaName = oriSchemaName;
    }

    public String getOriTableName()
    {
        return oriTableName;
    }

    public void setOriTableName(String oriTableName)
    {
        this.oriTableName = oriTableName;
    }

    public DdlResult getRenameTableResult()
    {
        return renameTableResult;
    }

    public void setRenameTableResult(DdlResult renameTableResult)
    {
        this.renameTableResult = renameTableResult;
    }

    @Override
    public DdlResult clone()
    {
        DdlResult ddlResult = new DdlResult();
        ddlResult.setOriSchemaName(oriSchemaName);
        ddlResult.setOriTableName(oriTableName);
        ddlResult.setSchemaName(schemaName);
        ddlResult.setTableName(tableName);
        // result.setType(type);
        return ddlResult;
    }


}
